home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / mus / misc / normalize.lha / README < prev    next >
Encoding:
Text File  |  2001-07-23  |  10.7 KB  |  223 lines

  1.  
  2. Note for Amiga users:
  3.  
  4. Please download and install the ixemul environment, available on Aminet
  5. under the name 'ixenv.lha'. It makes easier to install and increase
  6. compatibility with programs that use ixemul.library.
  7. Email me if you have problems: fr3dy@retemail.es
  8.  
  9. ------------------------------------------------------------------------
  10. This is release 0.6.1 of Normalize, a wave file volume normalizer.
  11. Copyright (C) 1999--2001, Chris Vaill <cvaill@cs.columbia.edu>
  12.  
  13. Normalize is an overly complicated tool for adjusting the volume of
  14. wave files to a standard level.  This is useful for things like
  15. creating mixed CD's and mp3 collections, where different recording
  16. levels on different albums can cause the volume to vary greatly from
  17. song to song.
  18.  
  19. To build, just run:
  20.  
  21. ./configure
  22. make
  23. make install
  24.  
  25. See the file INSTALL for more extensive directions.
  26. See the man page, normalize.1, for usage.
  27.  
  28. Send bug reports, suggestions, comments to cvaill@cs.columbia.edu.
  29.  
  30. normalize is free software.  See the file COPYING for copying conditions.
  31.  
  32. -------------------------------------------------------------------------
  33.  
  34. 1 What platforms does this work on?
  35.        I've tested normalize on GNU/Linux and FreeBSD on x86 and
  36.        Solaris on sparc.  I've heard that it works on GNU/Linux
  37.        on alpha and on BeOS R5.  As far as Windows is concerned,
  38.        you may be able to compile it using the cygwin toolkit
  39.        (see http://www.cygwin.com/), but I don't know.
  40.  
  41.        I've tried to make the code as portable as possible, so
  42.        I'd appreciate hearing whether normalize works on other
  43.        platforms.
  44.  
  45. 2 What is this useful for?
  46.        Let's say you've got a bunch of wav files containing what
  47.        are, in your estimation, Elvis's greatest hits, collected
  48.        from various albums.  You want to encode them as mp3's and
  49.        add them to an established collection, but since they're
  50.        all from different albums, they're all recorded at differ­
  51.        ent volumes from each other and from the rest of your mp3
  52.        collection.  If you've been using normalize on all your
  53.        wav files before you encode them, your collection is nor­
  54.        malized to the default volume level, and you want these
  55.        new additions to be at the same level.  Just run normalize
  56.        with no options on the files, and each will be adjusted to
  57.        the proper volume level:
  58.  
  59.             normalize "Hound Dog.wav" "Blue Suede Shoes.wav" \
  60.                       "Here Comes Santa Claus.wav" ...
  61.  
  62.        Suppose now you've just extracted all the wav files from
  63.        the Gorilla Biscuits album "Start Today," which, you may
  64.        know, is recorded at a particularly low volume.  We want
  65.        to make the whole album louder, but individual tracks
  66.        should stay at the same volume relative to each other.
  67.        For this we use batch mode.  Say the files are named
  68.        01.wav to 14.wav, and are in the current directory.  We
  69.        invoke normalize in batch mode to preserve the relative
  70.        volumes, but otherwise, everything's the default:
  71.  
  72.             normalize -b *.wav
  73.  
  74.        You can then fire up your mp3 encoder, and the whole album
  75.        will be uniformly louder.
  76.  
  77.        Now suppose we want to encode the Converge album "When
  78.        Forever Comes Crashing."  This album has one song, "Ten
  79.        Cents," that is really quiet while the rest of the songs
  80.        have about the same (loud) volume.  We'll turn up the ver­
  81.        bosity so we can see what's going on:
  82.  
  83.             > normalize -bv *.wav
  84.             Computing levels...
  85.             Level for track01.cdda.wav: -9.3980dBFS (0.0000dBFS peak)
  86.             Level for track02.cdda.wav: -9.2464dBFS (-0.1538dBFS peak)
  87.             Level for track03.cdda.wav: -8.6308dBFS (-0.2520dBFS peak)
  88.             Level for track04.cdda.wav: -8.7390dBFS (0.0000dBFS peak)
  89.             Level for track05.cdda.wav: -8.1000dBFS (-0.0003dBFS peak)
  90.             Level for track06.cdda.wav: -8.2215dBFS (-0.1754dBFS peak)
  91.             Level for track07.cdda.wav: -8.9346dBFS (-0.1765dBFS peak)
  92.             Level for track08.cdda.wav: -13.6175dBFS (-0.4552dBFS peak)
  93.             Level for track09.cdda.wav: -9.0107dBFS (-0.1778dBFS peak)
  94.             Level for track10.cdda.wav: -8.1824dBFS (-0.4519dBFS peak)
  95.             Level for track11.cdda.wav: -8.5700dBFS (-0.1778dBFS peak)
  96.             Standard deviation is 1.47 dB
  97.             Throwing out level of -13.6175dBFS (different by 4.58dB)
  98.             Average level: -8.6929dBFS
  99.             Applying adjustment of -3.35dB...
  100.  
  101.        The volume of "Ten Cents," which is track 8, is 4.58 deci­
  102.        bels off the average, which, given a standard deviation of
  103.        1.47 decibels, makes it a statistical aberration (which
  104.        I've defined as anything off by more that twice the stan­
  105.        dard deviation, but you can set a constant decibel thresh­
  106.        old with the -t option).  Therefore, it isn't counted in
  107.        the average, and the adjustment applied to the album isn't
  108.        thrown off because of one song.  Although the aberrant
  109.        song's volume is not counted in the average, it is
  110.        adjusted along with the rest of the files.
  111.  
  112.        Finally, say you want to make a mixed CD of 80's songs for
  113.        your mom or something.  You won't allow any 80's songs to
  114.        taint your hallowed mp3 collection, so the absolute vol­
  115.        umes of these tracks don't matter, as long as they're all
  116.        about the same, so mom doesn't have to keep adjusting the
  117.        volume.  For this, use the mix mode option,
  118.  
  119.             normalize -m *.wav
  120.  
  121.        and each track will be adjusted to the average level of
  122.        all the tracks.
  123.  
  124. 3 How does it work?
  125.        This is just a little background on how normalize computes
  126.        the volume of a wav file, in case you want to know just
  127.        how your files are being munged.
  128.  
  129.        The volumes calculated are RMS amplitudes, which corre­
  130.        spond (roughly) to perceived volume.  Taking the RMS
  131.        amplitude of an entire file would not give us quite the
  132.        measure we want, though, because a quiet song punctuated
  133.        by short loud parts would average out to a quiet song, and
  134.        the adjustment we would compute would make the loud parts
  135.        excessively loud.
  136.  
  137.        What we want is to consider the maximum volume of the
  138.        file, and normalize according to that.  We break up the
  139.        signal into 100 chunks per second, and get the signal
  140.        power of each chunk, in order to get an estimation of
  141.        "instantaneous power" over time.  This "instantaneous
  142.        power" signal varies too much to get a good measure of the
  143.        original signal's maximum sustained power, so we run a
  144.        smoothing algorithm over the power signal (specifically, a
  145.        mean filter with a window width of 100 elements).  The
  146.        maximum point of the smoothed power signal turns out to be
  147.        a good measure of the maximum sustained power of the file.
  148.        We can then take the square root of the power to get maxi­
  149.        mum sustained RMS amplitude.
  150.  
  151.        As for the default target amplitude of 0.25 (-12dBFS),
  152.        I've found that it's pretty close to the level of most of
  153.        my albums already, but not so high as to cause a lot of
  154.        limiting on quieter albums.  You may want to choose a dif­
  155.        ferent target amplitude, depending on your music collec­
  156.        tion (just make sure you normalize everything to the same
  157.        amplitude if you want it to all be the same volume!).
  158.  
  159.        Regarding clipping: since version 0.6, a limiter is
  160.        employed to eliminate clipping.  The limiter is on by
  161.        default; you don't have to do anything to use it.  The 0.5
  162.        series had a -c option to turn on limiting, but that lim­
  163.        iter caused problems with inexact volume adjustment.  The
  164.        new limiter doesn't have this problem, and the -c option
  165.        is considered deprecated (it will be removed in version
  166.        1.0).
  167.  
  168.        Please note that I'm not a recording engineer or an elec­
  169.        trical engineer, so my signal processing theory may be
  170.        off.  I'd be glad to hear from any signal processing wiz­
  171.        ards if I've made faulty assumptions regarding signal
  172.        power, perceived volume, or any of that fun signal theory
  173.        stuff.
  174.  
  175. 4 Why don't you normalize using peak levels instead of RMS amplitude?
  176.        Well, in early (unreleased) versions, this is how it
  177.        worked. I found that this just didn't work well.  The vol­
  178.        ume that your ear hears corresponds more closely with
  179.        average RMS amplitude level than with peak level.  There­
  180.        fore, making the RMS amplitude of two files equal makes
  181.        their perceived volume equal.  (Approximately equal, any­
  182.        way: certain frequencies sound louder at the same ampli­
  183.        tude because the ear is just more sensitive to those fre­
  184.        quencies.  I may try to take this into account in a future
  185.        version, but that opens up a whole new can of worms.)
  186.  
  187.        "Normalizing" by peak level generally makes files with
  188.        small dynamic range very loud and does nothing to files
  189.        with large dynamic ranges.  There's not really any normal­
  190.        ization being done, it's more of a histogram expansion.
  191.        That said, since version 0.5, you can use the --peak
  192.        option to do this in normalize.
  193.  
  194. 5 Can you make normalize operate directly on mp3 files?
  195.        The short answer is maybe -- I'm looking into it.
  196.  
  197.        MPEG layer III audio files store audio data as Huffman-
  198.        coded frequency components.  Theoretically, frequency com­
  199.        ponents can be analyzed and adjusted just as easily as
  200.        time-domain samples (such as the PCM samples in a WAV
  201.        file).  However, because the samples are Huffman-coded, it
  202.        is likely that decoding the samples, adjusting them, and
  203.        re-encoding them will cause them to take more or less bits
  204.        than before.  This is a problem, since MPEG audio files
  205.        have a set bitrate.  Layer III files have a bit reservoir
  206.        mechanism that could absorb some of the changes, but
  207.        essentially there's no guarantee that adjusted audio data
  208.        will still fit in the MP3 file.  The process of getting
  209.        the data to fit in the given bitrate is basically the same
  210.        as the encoding process.  That is, it's hard.
  211.  
  212.        A simpler task, which normalize may be able to do soon, is
  213.        to analyze an MP3 file, and set its volume adjustment ID3
  214.        tag instead of actually adjusting the audio data.  The
  215.        only problem with this method is that I don't know of any
  216.        MP3 players that honor this tag.
  217.  
  218.        The current situation is that to normalize an mp3 file,
  219.        you can decode it to WAV, normalize the WAV, and re-encode
  220.        it, but you incur the encoding loss a second time. If you
  221.        don't mind the loss, you can do just this with the
  222.        "normalize-mp3" script that is included in the distribution.
  223.